package utils.data

import scala.reflect.ClassTag

object CEnum
{
    def apply[T:ClassTag](clazz:Class[T], self:AnyRef) =
    {
        Array(self.getClass.getDeclaredFields filter (_.getType.isAssignableFrom(clazz)) map (f =>
        {
            f.setAccessible(true)
            f.get(self).asInstanceOf[T]
        }):_*)
    }
}
